from django.contrib.auth import logout as auth_logout
import ibm_db

def logout(request):
    """Disconnects Db2 connection and then calls
    django.contrib.auth.logout
    """
    dbconn = request.session.get('db2conn')
    try:
        ibm_db.close(dbconn)
    finally:
         auth_logout(request)
